﻿using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using Styx.Common;
using Styx.CommonBot;

namespace TuanHA_Paladin
{
    public partial class THForm : Form
    {
        public THForm()
        {
            InitializeComponent();
        }

        public static string GetCurrentSpec()
        {
            if (SpellManager.HasSpell("Avenger's Shield"))
            {
                return "Protection";
            }
            if (SpellManager.HasSpell("Holy Insight"))
            {
                return "Holy";
            }
            return "Retribution";
        }

        public int TalentValue(int holy, int protection, int retribution)
        {
            return GetCurrentSpec() == "Holy" ? holy : (GetCurrentSpec() == "Protection" ? protection : retribution);
        }

        public bool TalentValue(bool holy, bool protection, bool retribution)
        {
            return GetCurrentSpec() == "Holy" ? holy : (GetCurrentSpec() == "Protection" ? protection : retribution);
        }

        private void THForm_Load(object sender, EventArgs e)
        {
            #region DataGridView

            //DataGridView Debuff to Cleanse ASAP
            dvCleanseASAP.DataSource = THSettings.Instance.DsCleanseASAP;
            dvCleanseASAP.DataMember = "data";
            dvCleanseASAP.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
            dvCleanseASAP.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            #endregion

            #region _currentSpec

            if (GetCurrentSpec() == "Protection")
            {
                tabControl1.TabPages.Remove(tabPage3);
                tabControl1.TabPages.Remove(tabPage5);
            }
            else if (GetCurrentSpec() == "Holy")
            {
                tabControl1.TabPages.Remove(tabPage4);
                tabControl1.TabPages.Remove(tabPage5);
            }
            else
            {
                tabControl1.TabPages.Remove(tabPage3);
                tabControl1.TabPages.Remove(tabPage4);
            }

            #endregion

            THSettings.Instance.Load();

            #region Load Files

            if (
                File.Exists(Utilities.AssemblyDirectory +
                            @"\Routines\TuanHAPaladinSpecialEdition\TuanHA-Paladin-Picture.jpg"))
            {
                pictureBox1.ImageLocation = Utilities.AssemblyDirectory +
                                            @"\Routines\TuanHAPaladinSpecialEdition\TuanHA-Paladin-Picture.jpg";
            }

            if (File.Exists(Utilities.AssemblyDirectory +
                            @"\Routines\TuanHAPaladinSpecialEdition\SpecialThanks.rtf"))
            {
                richTextBox1.LoadFile(Utilities.AssemblyDirectory +
                                      @"\Routines\TuanHAPaladinSpecialEdition\SpecialThanks.rtf");
            }

            #endregion

            #region Load General

            THSettings.Instance.SPause = false;
            SRebuke.Value = THSettings.Instance.SRebuke;
            SHammerofJustice.Value = THSettings.Instance.SHammerofJustice;
            SBlindingLight.Value = THSettings.Instance.SBlindingLight;
            SHandofProtectionRemoveCC.Checked = THSettings.Instance.SHandofProtectionRemoveCC;
            SRepentanceCC.Checked = THSettings.Instance.SRepentanceCC;

            STrinket1.SelectedIndex = THSettings.Instance.STrinket1;
            STrinket1HP.Value = THSettings.Instance.STrinket1HP;
            STrinket2.SelectedIndex = THSettings.Instance.STrinket2;
            STrinket2HP.Value = THSettings.Instance.STrinket2HP;
            SProfBuff.SelectedIndex = THSettings.Instance.SProfBuff;
            SProfBuffHP.Value = THSettings.Instance.SProfBuffHP;
            SBurstKey.SelectedIndex = THSettings.Instance.SBurstKey;
            SBurstHP.Value = THSettings.Instance.SBurstHP;
            SHealthStone.Value = THSettings.Instance.SHealthStone;

            SCrowdControl.Value = THSettings.Instance.SCrowdControl;
            SDevotionAura.Value = THSettings.Instance.SDevotionAura;
            SDivinePlea.Value = THSettings.Instance.SDivinePlea;
            SDivineProtection.Value = THSettings.Instance.SDivineProtection;
            SDivineShield.Value = THSettings.Instance.SDivineShield;
            SHandofSacrifice.Value = THSettings.Instance.SHandofSacrifice;
            SHandofProtection.Value = THSettings.Instance.SHandofProtection;
            SLayonHands.Value = THSettings.Instance.SLayonHands;
            SSelflessHealer.Value = THSettings.Instance.SSelflessHealer;
            SUse90Attack.Value = THSettings.Instance.SUse90Attack;
            SUse90Defense.Value = THSettings.Instance.SUse90Defense;

            SHandofFreedomMyself.Checked = THSettings.Instance.SHandofFreedomMyself;
            SHandofFreedomMelee.Checked = THSettings.Instance.SHandofFreedomMelee;
            SHandofFreedomCaster.Checked = THSettings.Instance.SHandofFreedomCaster;
            SHandofFreedomHealer.Checked = THSettings.Instance.SHandofFreedomHealer;


            SBuff.Checked = THSettings.Instance.SBuff;
            SMoveToTarget.Checked = THSettings.Instance.SMoveToTarget;
            SRighteousFury.Checked = THSettings.Instance.SRighteousFury;
            SRacial.Checked = THSettings.Instance.SRacial;
            SAutoTarget.Checked = THSettings.Instance.SAutoTarget;
            STaunt.Checked = THSettings.Instance.STaunt;
            STurnEvil.Checked = THSettings.Instance.STurnEvil;
            SPreferKings.Checked = THSettings.Instance.SPreferKings;
            SPreferMight.Checked = THSettings.Instance.SPreferMight;
            SFace.Checked = THSettings.Instance.SFace;

            SStartEating.Value = THSettings.Instance.SStartEating;
            SPauseKey.SelectedIndex = THSettings.Instance.SPauseKey;
            SAoEKey.SelectedIndex = THSettings.Instance.SAOEKey;

            SStrafleLeft.SelectedIndex = THSettings.Instance.SStrafleLeft;
            SForward.SelectedIndex = THSettings.Instance.SForward;
            SStrafleRight.SelectedIndex = THSettings.Instance.SStrafleRight;
            STurnLeft.SelectedIndex = THSettings.Instance.STurnLeft;
            SBackward.SelectedIndex = THSettings.Instance.SBackward;
            STurnRight.SelectedIndex = THSettings.Instance.STurnRight;

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = THSettings.Instance.SCleanseASAP;
            SCleanseDebuffNumber.Value = THSettings.Instance.SCleanseDebuffNumber;

            SManaforDPS.Value = THSettings.Instance.SManaforDPS;
            SCrusaderStrike.Checked = THSettings.Instance.SCrusaderStrike;
            SDenounce.Checked = THSettings.Instance.SDenounce;
            SHammerofWrath.Checked = THSettings.Instance.SHammerofWrath;
            SHolyShockOffensive.Checked = THSettings.Instance.SHolyShockOffensive;
            SJudgment.Checked = THSettings.Instance.SJudgment;

            SBeaconofLight.Checked = THSettings.Instance.SBeaconofLight;
            SHolyRadianceUnit.Value = THSettings.Instance.SHolyRadianceUnit;
            SHolyRadiance.Value = THSettings.Instance.SHolyRadiance;
            SLightofDawnUnit.Value = THSettings.Instance.SLightofDawnUnit;
            SLightofDawn.Value = THSettings.Instance.SLightofDawn;

            SAvengingWrathHP.Value = THSettings.Instance.SAvengingWrathHP;
            SDivineFavor.Value = THSettings.Instance.SDivineFavor;
            SDivineLight.Value = THSettings.Instance.SDivineLight;
            SEternalFlameBlanketHolyPower.Value = THSettings.Instance.SEternalFlameBlanketHolyPower;
            SFlashofLight.Value = THSettings.Instance.SFlashofLight;
            SGuardianofAncientKingsHP.Value = THSettings.Instance.SGuardianofAncientKingsHP;
            SHolyAvenger.Value = THSettings.Instance.SHolyAvenger;
            SHolyLight.Value = THSettings.Instance.SHolyLight;
            SWordofGlory.Value = THSettings.Instance.SWordofGlory;

            SGroup1.Checked = THSettings.Instance.SGroup1;
            SGroup2.Checked = THSettings.Instance.SGroup2;
            SGroup3.Checked = THSettings.Instance.SGroup3;
            SGroup4.Checked = THSettings.Instance.SGroup4;
            SGroup5.Checked = THSettings.Instance.SGroup5;
            SGroup6.Checked = THSettings.Instance.SGroup6;
            SGroup7.Checked = THSettings.Instance.SGroup7;
            SGroup8.Checked = THSettings.Instance.SGroup8;

            #endregion

            #region Load Retribution 

            SSacredShieldRet.Checked = THSettings.Instance.SSacredShieldRet;
            SDivineStormUnit.Value = THSettings.Instance.SDivineStormUnit;
            SFlashofLightMeRet.Value = THSettings.Instance.SFlashofLightMeRet;
            SFlashofLightFriendRet.Value = THSettings.Instance.SFlashofLightFriendRet;
            SHammeroftheRighteousUnit.Value = THSettings.Instance.SHammeroftheRighteousUnit;
            SInquisitionHolyPower.Value = THSettings.Instance.SInquisitionHolyPower;
            SUnittoStartAoE.Value = THSettings.Instance.SUnittoStartAoE;
            SUnittoSealofRighteousness.Value = THSettings.Instance.SUnittoSealofRighteousness;
            SWordofGloryMeRet.Value = THSettings.Instance.SWordofGloryMeRet;
            SWordofGloryFriendRet.Value = THSettings.Instance.SWordofGloryFriendRet;

            #endregion

            #region Load Protection

            SArdentDefender.Value = THSettings.Instance.SArdentDefender;
            SFlashofLightMeProt.Value = THSettings.Instance.SFlashofLightMeRet;
            SGuardianofAncientKingsProt.Value = THSettings.Instance.SGuardianofAncientKingsProt;
            SUnittoStartAoEProt.Value = THSettings.Instance.SUnittoStartAoE;
            SUnittoSealofRighteousnessProt.Value = THSettings.Instance.SUnittoSealofRighteousness;
            SWordofGloryMeProt.Value = THSettings.Instance.SWordofGloryMeRet;

            #endregion

            if (THSettings.Instance.SLastSavedSpec != GetCurrentSpec())
            {
                Logging.Write("----------------------------------");
                Logging.Write("Load Default Setting");
                Logging.Write("----------------------------------");
                LoadDefaultSetting();
            }
        }

        #region Main Page

        #region OK

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("http://tuanha2000vn.wordpress.com/");
        }

        private void BOK_Click(object sender, EventArgs e)
        {
            //Write DsCleanseASAP to XML
            var dsCleanseASAPFileStream = new FileStream(THSettings.Instance.PathCleanseASAP, FileMode.Create);
            var dsCleanseASAPXmlWriter = new XmlTextWriter(dsCleanseASAPFileStream, Encoding.UTF8);
            dsCleanseASAPXmlWriter.Formatting = Formatting.Indented;
            dsCleanseASAPXmlWriter.WriteStartDocument(true);
            THSettings.Instance.DsCleanseASAP.WriteXml(dsCleanseASAPXmlWriter);
            dsCleanseASAPXmlWriter.Close();

            //MessageBox.Show("TuanHA Paladin Settings have been saved", "Save");
            THSettings.Instance.SLastSavedSpec = GetCurrentSpec();
            THSettings.Instance.Save();
            Logging.Write("----------------------------------");
            Logging.Write("TuanHA Paladin Settings have been saved");
            Close();

            THSettings.Instance.UpdateStatus = true;
        }

        #endregion

        #region Save

        private void bSave_Click(object sender, EventArgs e)
        {
            //Write DsCleanseASAP to XML
            var dsCleanseASAPFileStream = new FileStream(THSettings.Instance.PathCleanseASAP, FileMode.Create);
            var dsCleanseASAPXmlWriter = new XmlTextWriter(dsCleanseASAPFileStream, Encoding.UTF8);
            dsCleanseASAPXmlWriter.Formatting = Formatting.Indented;
            dsCleanseASAPXmlWriter.WriteStartDocument(true);
            THSettings.Instance.DsCleanseASAP.WriteXml(dsCleanseASAPXmlWriter);
            dsCleanseASAPXmlWriter.Close();

            THSettings.Instance.SLastSavedSpec = GetCurrentSpec();
            THSettings.Instance.Save();
            Logging.Write("TuanHA Paladin Settings have been saved");
            THSettings.Instance.UpdateStatus = true;
        }

        #endregion

        #region Dungeon

        private void BDungeon_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Dungeon Mode: Work best with LazyRaider in Dungeon.\r\n\r\nHoly Specialization use faster heal logic that take more of mana.",
                "Important Note",
                MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Dungeon Mode On");
            Logging.Write("----------------------------------");

            #region Load General

            SRebuke.Value = TalentValue(0, 2000, 2000);
            SHammerofJustice.Value = TalentValue(0, 2000, 2000);
            SBlindingLight.Value = TalentValue(0, 2000, 2000);
            SHandofProtectionRemoveCC.Checked = TalentValue(false, false, false);
            SRepentanceCC.Checked = TalentValue(false, true, false);

            //SProfBuff.SelectedIndex = TalentValue(5, 6, 6);
            //SProfBuffHP.Value = TalentValue(40, 100, 90);
            //SBurstKey.SelectedIndex = TalentValue(5, 6, 6);
            //SBurstHP.Value = TalentValue(40, 100, 90);
            SHealthStone.Value = TalentValue(40, 40, 40);

            SCrowdControl.Value = TalentValue(60, 60, 60);
            SDevotionAura.Value = TalentValue(60, 60, 60);
            SDivinePlea.Value = TalentValue(80, 60, 60);
            SDivineProtection.Value = TalentValue(80, 80, 80);
            SDivineShield.Value = TalentValue(10, 10, 20);
            SHandofSacrifice.Value = TalentValue(60, 0, 0);
            SHandofProtection.Value = TalentValue(20, 10, 20);
            SLayonHands.Value = TalentValue(10, 10, 10);
            SSelflessHealer.Value = TalentValue(80, 80, 0);
            SUse90Attack.Value = TalentValue(0, 100, 100);
            SUse90Defense.Value = TalentValue(80, 50, 0);

            SHandofFreedomMyself.Checked = TalentValue(false, false, false);
            SHandofFreedomMelee.Checked = TalentValue(false, false, false);
            SHandofFreedomCaster.Checked = TalentValue(false, false, false);
            SHandofFreedomHealer.Checked = TalentValue(false, false, false);


            SBuff.Checked = TalentValue(true, true, true);
            SMoveToTarget.Checked = TalentValue(false, false, false);
            SRighteousFury.Checked = TalentValue(true, true, true);
            SRacial.Checked = TalentValue(true, true, true);
            SAutoTarget.Checked = TalentValue(false, true, false);
            STaunt.Checked = TalentValue(false, true, false);
            STurnEvil.Checked = TalentValue(false, false, false);
            SPreferKings.Checked = TalentValue(true, true, false);
            SPreferMight.Checked = TalentValue(false, false, true);
            SFace.Checked = TalentValue(true, true, true);

            SStartEating.Value = TalentValue(60, 10, 10);

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = TalentValue(false, false, false);
            SCleanseDebuffNumber.Value = TalentValue(1, 0, 0);

            SManaforDPS.Value = TalentValue(100, 0, 0);
            SCrusaderStrike.Checked = TalentValue(false, true, true);
            SDenounce.Checked = TalentValue(false, false, false);
            SHammerofWrath.Checked = TalentValue(false, true, true);
            SHolyShockOffensive.Checked = TalentValue(false, false, false);
            SJudgment.Checked = TalentValue(false, true, true);

            SBeaconofLight.Checked = TalentValue(true, true, true);
            SHolyRadianceUnit.Value = TalentValue(3, 3, 3);
            SHolyRadiance.Value = TalentValue(90, 90, 90);
            SLightofDawnUnit.Value = TalentValue(3, 3, 3);
            SLightofDawn.Value = TalentValue(95, 95, 95);

            SAvengingWrathHP.Value = TalentValue(60, 100, 90);
            SDivineFavor.Value = TalentValue(60, 60, 60);
            SDivineLight.Value = TalentValue(60, 60, 60);
            SEternalFlameBlanketHolyPower.Value = TalentValue(1, 0, 0);
            SFlashofLight.Value = TalentValue(40, 40, 40);
            SGuardianofAncientKingsHP.Value = TalentValue(50, 50, 50);
            SHolyAvenger.Value = TalentValue(70, 70, 70);
            SHolyLight.Value = TalentValue(95, 95, 95);
            SWordofGlory.Value = TalentValue(90, 50, 50);

            SGroup1.Checked = true;
            SGroup2.Checked = true;
            SGroup3.Checked = true;
            SGroup4.Checked = true;
            SGroup5.Checked = true;
            SGroup6.Checked = true;
            SGroup7.Checked = true;
            SGroup8.Checked = true;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = TalentValue(true, true, false);
            SDivineStormUnit.Value = TalentValue(2, 2, 2);
            SFlashofLightMeRet.Value = TalentValue(0, 0, 0);
            SFlashofLightFriendRet.Value = TalentValue(0, 0, 0);
            SHammeroftheRighteousUnit.Value = TalentValue(4, 4, 4);
            SInquisitionHolyPower.Value = TalentValue(3, 3, 3);
            SUnittoStartAoE.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousness.Value = TalentValue(8, 8, 8);
            SWordofGloryMeRet.Value = TalentValue(0, 0, 0);
            SWordofGloryFriendRet.Value = TalentValue(0, 0, 0);

            #endregion

            #region Load Protection

            SArdentDefender.Value = TalentValue(25, 25, 25);
            SFlashofLightMeProt.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsProt.Value = TalentValue(50, 50, 50);
            SUnittoStartAoEProt.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousnessProt.Value = TalentValue(8, 8, 8);
            SWordofGloryMeProt.Value = TalentValue(70, 70, 70);

            #endregion
        }

        #endregion

        #region Raid

        private void BRaid_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Raid Mode: Work best with LazyRaider in Raiding.\r\n\r\nHoly Specialization use slower heal logic to save mana.",
                "Important Note",
                MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Raid Mode On");
            Logging.Write("----------------------------------");

            #region Load General

            SRebuke.Value = TalentValue(0, 0, 0);
            SHammerofJustice.Value = TalentValue(0, 0, 0);
            SBlindingLight.Value = TalentValue(0, 0, 0);
            SHandofProtectionRemoveCC.Checked = TalentValue(false, false, false);
            SRepentanceCC.Checked = TalentValue(false, false, false);

            //SProfBuff.SelectedIndex = TalentValue(5, 6, 6);
            //SProfBuffHP.Value = TalentValue(40, 100, 90);
            //SBurstKey.SelectedIndex = TalentValue(5, 6, 6);
            //SBurstHP.Value = TalentValue(40, 100, 90);
            SHealthStone.Value = TalentValue(40, 40, 40);

            SCrowdControl.Value = TalentValue(0, 0, 0);
            SDevotionAura.Value = TalentValue(70, 70, 70);
            SDivinePlea.Value = TalentValue(70, 70, 70);
            SDivineProtection.Value = TalentValue(80, 80, 80);
            SDivineShield.Value = TalentValue(30, 30, 30);
            SHandofSacrifice.Value = TalentValue(25, 0, 0);
            SHandofProtection.Value = TalentValue(20, 20, 20);
            SLayonHands.Value = TalentValue(20, 20, 20);
            SSelflessHealer.Value = TalentValue(80, 80, 0);
            SUse90Attack.Value = TalentValue(0, 100, 100);
            SUse90Defense.Value = TalentValue(80, 50, 0);

            SHandofFreedomMyself.Checked = TalentValue(false, false, false);
            SHandofFreedomMelee.Checked = TalentValue(false, false, false);
            SHandofFreedomCaster.Checked = TalentValue(false, false, false);
            SHandofFreedomHealer.Checked = TalentValue(false, false, false);


            SBuff.Checked = TalentValue(true, true, true);
            SMoveToTarget.Checked = TalentValue(false, false, false);
            SRighteousFury.Checked = TalentValue(true, true, true);
            SRacial.Checked = TalentValue(true, true, true);
            SAutoTarget.Checked = TalentValue(false, false, false);
            STaunt.Checked = TalentValue(false, false, false);
            STurnEvil.Checked = TalentValue(false, false, false);
            SFace.Checked = TalentValue(true, true, true);
            SPreferKings.Checked = TalentValue(true, true, false);
            SPreferMight.Checked = TalentValue(false, false, true);

            SStartEating.Value = TalentValue(60, 10, 10);

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = TalentValue(false, false, false);
            SCleanseDebuffNumber.Value = TalentValue(0, 0, 0);

            SManaforDPS.Value = TalentValue(100, 0, 0);
            SCrusaderStrike.Checked = TalentValue(false, true, true);
            SDenounce.Checked = TalentValue(false, false, false);
            SHammerofWrath.Checked = TalentValue(false, true, true);
            SHolyShockOffensive.Checked = TalentValue(false, false, false);
            SJudgment.Checked = TalentValue(false, true, true);

            SBeaconofLight.Checked = TalentValue(true, true, true);
            SHolyRadianceUnit.Value = TalentValue(3, 3, 3);
            SHolyRadiance.Value = TalentValue(90, 90, 90);
            SLightofDawnUnit.Value = TalentValue(3, 3, 3);
            SLightofDawn.Value = TalentValue(95, 95, 95);

            SAvengingWrathHP.Value = TalentValue(50, 100, 90);
            SDivineFavor.Value = TalentValue(50, 50, 50);
            SDivineLight.Value = TalentValue(50, 50, 50);
            SEternalFlameBlanketHolyPower.Value = TalentValue(0, 0, 0);
            SFlashofLight.Value = TalentValue(35, 35, 35);
            SGuardianofAncientKingsHP.Value = TalentValue(40, 40, 40);
            SHolyAvenger.Value = TalentValue(60, 60, 60);
            SHolyLight.Value = TalentValue(95, 95, 95);
            SWordofGlory.Value = TalentValue(60, 60, 60);

            SGroup1.Checked = true;
            SGroup2.Checked = true;
            SGroup3.Checked = true;
            SGroup4.Checked = true;
            SGroup5.Checked = true;
            SGroup6.Checked = true;
            SGroup7.Checked = true;
            SGroup8.Checked = true;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = TalentValue(true, true, false);
            SDivineStormUnit.Value = TalentValue(2, 2, 2);
            SFlashofLightMeRet.Value = TalentValue(0, 0, 0);
            SFlashofLightFriendRet.Value = TalentValue(0, 0, 0);
            SHammeroftheRighteousUnit.Value = TalentValue(4, 4, 4);
            SInquisitionHolyPower.Value = TalentValue(3, 3, 3);
            SUnittoStartAoE.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousness.Value = TalentValue(8, 8, 8);
            SWordofGloryMeRet.Value = TalentValue(0, 0, 0);
            SWordofGloryFriendRet.Value = TalentValue(0, 0, 0);

            #endregion

            #region Load Protection

            SArdentDefender.Value = TalentValue(25, 25, 25);
            SFlashofLightMeProt.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsProt.Value = TalentValue(50, 50, 50);
            SUnittoStartAoEProt.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousnessProt.Value = TalentValue(8, 8, 8);
            SWordofGloryMeProt.Value = TalentValue(70, 70, 70);

            #endregion
        }

        #endregion

        #region PVP

        private void BPvPHelper_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "PvP Mode: Work best with LazyRaider in PvP.\r\n\r\nHoly Specialization use fastest heal logic that take a lot of mana.",
                "Important Note", MessageBoxButtons.OK,
                MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("PvP Helper Mode On");
            Logging.Write("----------------------------------");

            #region Load General

            SRebuke.Value = TalentValue(2000, 2000, 2000);
            SHammerofJustice.Value = TalentValue(2000, 2000, 2000);
            SBlindingLight.Value = TalentValue(2000, 2000, 2000);
            SHandofProtectionRemoveCC.Checked = TalentValue(true, true, true);
            SRepentanceCC.Checked = TalentValue(true, true, true);

            //SProfBuff.SelectedIndex = TalentValue(5, 6, 6);
            //SProfBuffHP.Value = TalentValue(40, 70, 70);
            //SBurstKey.SelectedIndex = TalentValue(5, 6, 6);
            //SBurstHP.Value = TalentValue(40, 70, 70);
            SHealthStone.Value = TalentValue(40, 40, 40);

            SCrowdControl.Value = TalentValue(50, 50, 50);
            SDevotionAura.Value = TalentValue(65, 65, 65);
            SDivinePlea.Value = TalentValue(80, 60, 60);
            SDivineProtection.Value = TalentValue(80, 80, 80);
            SDivineShield.Value = TalentValue(30, 30, 30);
            SHandofSacrifice.Value = TalentValue(80, 80, 80);
            SHandofProtection.Value = TalentValue(40, 40, 40);
            SLayonHands.Value = TalentValue(30, 30, 30);
            SSelflessHealer.Value = TalentValue(80, 80, 80);
            SUse90Attack.Value = TalentValue(100, 100, 100);
            SUse90Defense.Value = TalentValue(80, 80, 80);

            SHandofFreedomMyself.Checked = TalentValue(true, true, true);
            SHandofFreedomMelee.Checked = TalentValue(true, true, true);
            SHandofFreedomCaster.Checked = TalentValue(false, false, false);
            SHandofFreedomHealer.Checked = TalentValue(false, false, false);


            SBuff.Checked = TalentValue(true, true, true);
            SMoveToTarget.Checked = TalentValue(false, false, false);
            SRighteousFury.Checked = TalentValue(true, true, true);
            SRacial.Checked = TalentValue(true, true, true);
            SAutoTarget.Checked = TalentValue(false, false, false);
            STaunt.Checked = TalentValue(true, true, true);
            STurnEvil.Checked = TalentValue(true, true, true);
            SFace.Checked = TalentValue(true, true, true);
            SPreferKings.Checked = TalentValue(true, true, false);
            SPreferMight.Checked = TalentValue(false, false, true);

            SStartEating.Value = TalentValue(60, 60, 60);

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = TalentValue(true, false, false);
            SCleanseDebuffNumber.Value = TalentValue(4, 0, 0);

            SManaforDPS.Value = TalentValue(50, 50, 50);
            SCrusaderStrike.Checked = TalentValue(true, true, true);
            SDenounce.Checked = TalentValue(true, true, true);
            SHammerofWrath.Checked = TalentValue(true, true, true);
            SHolyShockOffensive.Checked = TalentValue(true, true, true);
            SJudgment.Checked = TalentValue(true, true, true);

            SBeaconofLight.Checked = TalentValue(true, true, true);
            SHolyRadianceUnit.Value = TalentValue(0, 0, 0);
            SHolyRadiance.Value = TalentValue(0, 0, 0);
            SLightofDawnUnit.Value = TalentValue(0, 0, 0);
            SLightofDawn.Value = TalentValue(0, 0, 0);

            SAvengingWrathHP.Value = TalentValue(50, 70, 70);
            SDivineFavor.Value = TalentValue(50, 50, 50);
            SDivineLight.Value = TalentValue(85, 85, 85);
            SEternalFlameBlanketHolyPower.Value = TalentValue(0, 0, 0);
            SFlashofLight.Value = TalentValue(75, 50, 50);
            SGuardianofAncientKingsHP.Value = TalentValue(40, 40, 40);
            SHolyAvenger.Value = TalentValue(60, 60, 60);
            SHolyLight.Value = TalentValue(95, 95, 95);
            SWordofGlory.Value = TalentValue(90, 50, 50);

            SGroup1.Checked = true;
            SGroup2.Checked = true;
            SGroup3.Checked = true;
            SGroup4.Checked = true;
            SGroup5.Checked = true;
            SGroup6.Checked = true;
            SGroup7.Checked = true;
            SGroup8.Checked = true;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = TalentValue(true, true, true);
            SDivineStormUnit.Value = TalentValue(0, 0, 0);
            SFlashofLightMeRet.Value = TalentValue(50, 50, 50);
            SFlashofLightFriendRet.Value = TalentValue(30, 30, 30);
            SHammeroftheRighteousUnit.Value = TalentValue(0, 0, 0);
            SInquisitionHolyPower.Value = TalentValue(3, 3, 3);
            SUnittoStartAoE.Value = TalentValue(0, 0, 0);
            SUnittoSealofRighteousness.Value = TalentValue(0, 0, 0);
            SWordofGloryMeRet.Value = TalentValue(50, 50, 50);
            SWordofGloryFriendRet.Value = TalentValue(30, 30, 30);

            #endregion

            #region Load Protection

            SArdentDefender.Value = TalentValue(25, 25, 25);
            SFlashofLightMeProt.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsProt.Value = TalentValue(50, 50, 50);
            SUnittoStartAoEProt.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousnessProt.Value = TalentValue(8, 8, 8);
            SWordofGloryMeProt.Value = TalentValue(70, 70, 70);

            #endregion
        }

        #endregion

        #region Quest

        private void BQuestHelper_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Quest Helper Mode: Work best with LazyRaider in solo questing.\r\n\r\nFor use with Zigor (http://www.zygorguides.com/) Just select your target, the bot will move to melee range and attack.\r\n\r\nRemember disable plugin Glue.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Quest Helper Mode On");
            Logging.Write("----------------------------------");

            #region Load General

            SRebuke.Value = TalentValue(2000, 2000, 2000);
            SHammerofJustice.Value = TalentValue(2000, 2000, 2000);
            SBlindingLight.Value = TalentValue(2000, 2000, 2000);
            SHandofProtectionRemoveCC.Checked = TalentValue(false, false, false);
            SRepentanceCC.Checked = TalentValue(true, true, true);

            //SProfBuff.SelectedIndex = TalentValue(5, 6, 6);
            //SProfBuffHP.Value = TalentValue(40, 90, 90);
            //SBurstKey.SelectedIndex = TalentValue(5, 6, 6);
            //SBurstHP.Value = TalentValue(40, 90, 90);
            SHealthStone.Value = TalentValue(40, 40, 40);

            SCrowdControl.Value = TalentValue(50, 50, 50);
            SDevotionAura.Value = TalentValue(50, 50, 50);
            SDivinePlea.Value = TalentValue(80, 60, 60);
            SDivineProtection.Value = TalentValue(80, 80, 80);
            SDivineShield.Value = TalentValue(30, 30, 30);
            SHandofSacrifice.Value = TalentValue(80, 80, 80);
            SHandofProtection.Value = TalentValue(30, 30, 30);
            SLayonHands.Value = TalentValue(30, 30, 30);
            SSelflessHealer.Value = TalentValue(80, 80, 80);
            SUse90Attack.Value = TalentValue(100, 100, 100);
            SUse90Defense.Value = TalentValue(80, 80, 80);

            SHandofFreedomMyself.Checked = TalentValue(true, true, true);
            SHandofFreedomMelee.Checked = TalentValue(false, false, false);
            SHandofFreedomCaster.Checked = TalentValue(false, false, false);
            SHandofFreedomHealer.Checked = TalentValue(false, false, false);


            SBuff.Checked = TalentValue(true, true, true);
            SMoveToTarget.Checked = TalentValue(true, true, true);
            SRighteousFury.Checked = TalentValue(true, true, true);
            SRacial.Checked = TalentValue(true, true, true);
            SAutoTarget.Checked = TalentValue(false, false, false);
            STaunt.Checked = TalentValue(true, true, true);
            STurnEvil.Checked = TalentValue(true, true, true);
            SFace.Checked = TalentValue(true, true, true);
            SPreferKings.Checked = TalentValue(true, true, false);
            SPreferMight.Checked = TalentValue(false, false, true);

            SStartEating.Value = TalentValue(60, 60, 60);

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = TalentValue(false, false, false);
            SCleanseDebuffNumber.Value = TalentValue(2, 0, 0);

            SManaforDPS.Value = TalentValue(30, 30, 30);
            SCrusaderStrike.Checked = TalentValue(true, true, true);
            SDenounce.Checked = TalentValue(true, true, true);
            SHammerofWrath.Checked = TalentValue(true, true, true);
            SHolyShockOffensive.Checked = TalentValue(true, true, true);
            SJudgment.Checked = TalentValue(true, true, true);

            SBeaconofLight.Checked = TalentValue(true, true, true);
            SHolyRadianceUnit.Value = TalentValue(0, 0, 0);
            SHolyRadiance.Value = TalentValue(0, 0, 0);
            SLightofDawnUnit.Value = TalentValue(0, 0, 0);
            SLightofDawn.Value = TalentValue(0, 0, 0);

            SAvengingWrathHP.Value = TalentValue(50, 70, 70);
            SDivineFavor.Value = TalentValue(50, 50, 50);
            SDivineLight.Value = TalentValue(50, 50, 50);
            SEternalFlameBlanketHolyPower.Value = TalentValue(0, 0, 0);
            SFlashofLight.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsHP.Value = TalentValue(40, 40, 40);
            SHolyAvenger.Value = TalentValue(60, 60, 60);
            SHolyLight.Value = TalentValue(95, 95, 95);
            SWordofGlory.Value = TalentValue(70, 70, 70);

            SGroup1.Checked = true;
            SGroup2.Checked = true;
            SGroup3.Checked = true;
            SGroup4.Checked = true;
            SGroup5.Checked = true;
            SGroup6.Checked = true;
            SGroup7.Checked = true;
            SGroup8.Checked = true;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = TalentValue(true, true, true);
            SDivineStormUnit.Value = TalentValue(2, 2, 2);
            SFlashofLightMeRet.Value = TalentValue(50, 50, 50);
            SFlashofLightFriendRet.Value = TalentValue(30, 30, 30);
            SHammeroftheRighteousUnit.Value = TalentValue(4, 4, 4);
            SInquisitionHolyPower.Value = TalentValue(3, 3, 3);
            SUnittoStartAoE.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousness.Value = TalentValue(8, 8, 8);
            SWordofGloryMeRet.Value = TalentValue(50, 50, 50);
            SWordofGloryFriendRet.Value = TalentValue(30, 30, 30);

            #endregion

            #region Load Protection

            SArdentDefender.Value = TalentValue(25, 25, 25);
            SFlashofLightMeProt.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsProt.Value = TalentValue(50, 50, 50);
            SUnittoStartAoEProt.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousnessProt.Value = TalentValue(8, 8, 8);
            SWordofGloryMeProt.Value = TalentValue(70, 70, 70);

            #endregion
        }

        #endregion

        #region FullAFK

        private void BFullAfk_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Full AFK Mode: Work best with BGBuddy, ArcheologyBuddy, DungeonBuddy, Grind Bot, Questing...",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Full AFK Mode On");
            Logging.Write("----------------------------------");

            #region Load General

            SRebuke.Value = TalentValue(2000, 2000, 2000);
            SHammerofJustice.Value = TalentValue(2000, 2000, 2000);
            SBlindingLight.Value = TalentValue(2000, 2000, 2000);
            SHandofProtectionRemoveCC.Checked = TalentValue(false, false, false);
            SRepentanceCC.Checked = TalentValue(true, true, true);

            //SProfBuff.SelectedIndex = TalentValue(5, 6, 6);
            //SProfBuffHP.Value = TalentValue(40, 90, 90);
            //SBurstKey.SelectedIndex = TalentValue(5, 6, 6);
            //SBurstHP.Value = TalentValue(40, 90, 90);
            SHealthStone.Value = TalentValue(40, 40, 40);

            SCrowdControl.Value = TalentValue(50, 50, 50);
            SDevotionAura.Value = TalentValue(50, 50, 50);
            SDivinePlea.Value = TalentValue(80, 60, 60);
            SDivineProtection.Value = TalentValue(80, 80, 80);
            SDivineShield.Value = TalentValue(30, 30, 30);
            SHandofSacrifice.Value = TalentValue(80, 80, 80);
            SHandofProtection.Value = TalentValue(30, 30, 30);
            SLayonHands.Value = TalentValue(30, 30, 30);
            SSelflessHealer.Value = TalentValue(80, 80, 80);
            SUse90Attack.Value = TalentValue(100, 100, 100);
            SUse90Defense.Value = TalentValue(80, 80, 80);

            SHandofFreedomMyself.Checked = TalentValue(true, true, true);
            SHandofFreedomMelee.Checked = TalentValue(true, true, true);
            SHandofFreedomCaster.Checked = TalentValue(false, false, false);
            SHandofFreedomHealer.Checked = TalentValue(false, false, false);


            SBuff.Checked = TalentValue(true, true, true);
            SMoveToTarget.Checked = TalentValue(true, true, true);
            SRighteousFury.Checked = TalentValue(true, true, true);
            SRacial.Checked = TalentValue(true, true, true);
            SAutoTarget.Checked = TalentValue(false, false, false);
            STaunt.Checked = TalentValue(true, true, true);
            STurnEvil.Checked = TalentValue(true, true, true);
            SFace.Checked = TalentValue(true, true, true);
            SPreferKings.Checked = TalentValue(true, true, false);
            SPreferMight.Checked = TalentValue(false, false, true);

            SStartEating.Value = TalentValue(60, 60, 60);

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = TalentValue(true, true, true);
            SCleanseDebuffNumber.Value = TalentValue(2, 0, 0);

            SManaforDPS.Value = TalentValue(50, 30, 30);
            SCrusaderStrike.Checked = TalentValue(true, true, true);
            SDenounce.Checked = TalentValue(true, true, true);
            SHammerofWrath.Checked = TalentValue(true, true, true);
            SHolyShockOffensive.Checked = TalentValue(true, true, true);
            SJudgment.Checked = TalentValue(true, true, true);

            SBeaconofLight.Checked = TalentValue(true, true, true);
            SHolyRadianceUnit.Value = TalentValue(0, 0, 0);
            SHolyRadiance.Value = TalentValue(0, 0, 0);
            SLightofDawnUnit.Value = TalentValue(0, 0, 0);
            SLightofDawn.Value = TalentValue(0, 0, 0);

            SAvengingWrathHP.Value = TalentValue(50, 70, 70);
            SDivineFavor.Value = TalentValue(50, 50, 50);
            SDivineLight.Value = TalentValue(85, 85, 85);
            SEternalFlameBlanketHolyPower.Value = TalentValue(0, 0, 0);
            SFlashofLight.Value = TalentValue(75, 50, 50);
            SGuardianofAncientKingsHP.Value = TalentValue(40, 40, 40);
            SHolyAvenger.Value = TalentValue(60, 60, 60);
            SHolyLight.Value = TalentValue(95, 95, 95);
            SWordofGlory.Value = TalentValue(70, 40, 40);

            SGroup1.Checked = true;
            SGroup2.Checked = true;
            SGroup3.Checked = true;
            SGroup4.Checked = true;
            SGroup5.Checked = true;
            SGroup6.Checked = true;
            SGroup7.Checked = true;
            SGroup8.Checked = true;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = TalentValue(true, true, true);
            SDivineStormUnit.Value = TalentValue(2, 2, 2);
            SFlashofLightMeRet.Value = TalentValue(50, 50, 50);
            SFlashofLightFriendRet.Value = TalentValue(30, 30, 30);
            SHammeroftheRighteousUnit.Value = TalentValue(4, 4, 4);
            SInquisitionHolyPower.Value = TalentValue(3, 3, 3);
            SUnittoStartAoE.Value = TalentValue(5, 5, 5);
            SUnittoSealofRighteousness.Value = TalentValue(10, 10, 10);
            SWordofGloryMeRet.Value = TalentValue(50, 50, 50);
            SWordofGloryFriendRet.Value = TalentValue(30, 30, 30);

            #endregion

            #region Load Protection

            SArdentDefender.Value = TalentValue(25, 25, 25);
            SFlashofLightMeProt.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsProt.Value = TalentValue(50, 50, 50);
            SUnittoStartAoEProt.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousnessProt.Value = TalentValue(8, 8, 8);
            SWordofGloryMeProt.Value = TalentValue(70, 70, 70);

            #endregion
        }

        #endregion

        #endregion

        #region Interrupt and Other

        private void SRebuke_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SRebuke = (int) SRebuke.Value;
        }

        private void SHammerofJustice_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHammerofJustice = (int) SHammerofJustice.Value;
        }

        private void SBlidingLight_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SBlindingLight = (int) SBlindingLight.Value;
        }

        private void SHandofProtectionRemoveCC_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofProtectionRemoveCC = SHandofProtectionRemoveCC.Checked;
        }

        private void SRepentanceCC_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SRepentanceCC = SRepentanceCC.Checked;
        }

        private void STrinket1_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 7; i++)
            {
                if (STrinket1.SelectedIndex == i)
                {
                    THSettings.Instance.STrinket1 = i;
                }
            }
        }

        private void STrinket1HP_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.STrinket1HP = (int) STrinket1HP.Value;
        }

        private void STrinket2_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 7; i++)
            {
                if (STrinket2.SelectedIndex == i)
                {
                    THSettings.Instance.STrinket2 = i;
                }
            }
        }

        private void STrinket2HP_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.STrinket2HP = (int) STrinket2HP.Value;
        }

        private void SProfBuff_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 7; i++)
            {
                if (SProfBuff.SelectedIndex == i)
                {
                    THSettings.Instance.SProfBuff = i;
                }
            }
        }

        private void SProfBuffHP_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SProfBuffHP = (int) SProfBuffHP.Value;
        }

        private void SBurstKey_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 47; i++)
            {
                if (SBurstKey.SelectedIndex == i)
                {
                    THSettings.Instance.SBurstKey = i;
                }
            }
        }

        private void SBurstHP_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SBurstHP = (int) SBurstHP.Value;
        }

        private void SHealthStone_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHealthStone = (int) SHealthStone.Value;
        }

        #endregion

        #region Cooldown

        private void SCrowdControl_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SCrowdControl = (int) SCrowdControl.Value;
        }

        private void SDevotion_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDevotionAura = (int) SDevotionAura.Value;
        }

        private void SDivinePlea_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDivinePlea = (int) SDivinePlea.Value;
        }

        private void SDivine_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDivineProtection = (int) SDivineProtection.Value;
        }

        private void SDivineShield_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDivineShield = (int) SDivineShield.Value;
        }

        private void SHandofProtection_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofProtection = (int) SHandofProtection.Value;
        }

        private void SHandofSacrifice_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofSacrifice = (int) SHandofSacrifice.Value;
        }

        private void SLayonHands_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SLayonHands = (int) SLayonHands.Value;
        }

        private void SSelflessHealer_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SSelflessHealer = (int) SSelflessHealer.Value;
        }

        private void SUse90Attack_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SUse90Attack = (int) SUse90Attack.Value;
        }

        private void SUse90Defense_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SUse90Defense = (int) SUse90Defense.Value;
        }

        private void SHandofFreedomMyself_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofFreedomMyself = SHandofFreedomMyself.Checked;
        }

        private void SHandofFreedomMelee_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofFreedomMelee = SHandofFreedomMelee.Checked;
        }

        private void SHandofFreedomCaster_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofFreedomCaster = SHandofFreedomCaster.Checked;
        }

        private void SHandofFreedomHealer_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHandofFreedomHealer = SHandofFreedomHealer.Checked;
        }

        #endregion

        #region Control

        private void SBuff_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SBuff = SBuff.Checked;
        }

        private void SFace_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SFace = SFace.Checked;
        }

        private void SMoveToTarget_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SMoveToTarget = SMoveToTarget.Checked;
        }

        private void SRighteousFury_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SRighteousFury = SRighteousFury.Checked;
        }


        private void SRacial_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SRacial = SRacial.Checked;
        }

        private void STaunt_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.STaunt = STaunt.Checked;
        }

        private void SAutoTarget_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SAutoTarget = SAutoTarget.Checked;
        }

        private void STurnEvil_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.STurnEvil = STurnEvil.Checked;
        }

        private void SPreferKings_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SPreferKings = SPreferKings.Checked;
        }

        private void SPreferMight_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SPreferMight = SPreferMight.Checked;
        }


        private void SStartEating_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SStartEating = (int) SStartEating.Value;
        }

        private void SPauseKey_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (SPauseKey.SelectedIndex == i)
                {
                    THSettings.Instance.SPauseKey = i;
                }
            }
        }

        private void SAoEKey_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (SAoEKey.SelectedIndex == i)
                {
                    THSettings.Instance.SAOEKey = i;
                }
            }
        }


        private void SStrafleLeft_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (SStrafleLeft.SelectedIndex == i)
                {
                    THSettings.Instance.SStrafleLeft = i;
                }
            }
        }

        private void SForward_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (SForward.SelectedIndex == i)
                {
                    THSettings.Instance.SForward = i;
                }
            }
        }

        private void SStrafleRight_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (SStrafleRight.SelectedIndex == i)
                {
                    THSettings.Instance.SStrafleRight = i;
                }
            }
        }

        private void STurnLeft_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (STurnLeft.SelectedIndex == i)
                {
                    THSettings.Instance.STurnLeft = i;
                }
            }
        }

        private void SBackward_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (SBackward.SelectedIndex == i)
                {
                    THSettings.Instance.SBackward = i;
                }
            }
        }

        private void STurnRight_SelectedIndexChanged(object sender, EventArgs e)
        {
            for (var i = 0; i <= 40; i++)
            {
                if (STurnRight.SelectedIndex == i)
                {
                    THSettings.Instance.STurnRight = i;
                }
            }
        }

        #endregion

        #region Holy

        private void SCleanseASAP_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SCleanseASAP = SCleanseASAP.Checked;
        }

        private void SCleanseDebuffNumber_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SCleanseDebuffNumber = (int) SCleanseDebuffNumber.Value;
        }

        private void SManaforDPS_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SManaforDPS = (int) SManaforDPS.Value;
        }

        private void SCrusaderStrike_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SCrusaderStrike = SCrusaderStrike.Checked;
        }

        private void SDenounce_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDenounce = SDenounce.Checked;
        }

        private void SHammerofWrath_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHammerofWrath = SHammerofWrath.Checked;
        }


        private void SHolyShockOffensive_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHolyShockOffensive = SHolyShockOffensive.Checked;
        }

        private void SJudgment_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SJudgment = SJudgment.Checked;
        }

        private void SBeaconofLight_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SBeaconofLight = SBeaconofLight.Checked;
        }

        private void SHolyRadianceUnit_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHolyRadianceUnit = (int) SHolyRadianceUnit.Value;
        }

        private void SHolyRadiance_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHolyRadiance = (int) SHolyRadiance.Value;
        }

        private void SLightofDawnUnit_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SLightofDawnUnit = (int) SLightofDawnUnit.Value;
        }

        private void SLightofDawn_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SLightofDawn = (int) SLightofDawn.Value;
        }

        private void SAvengingWrathHP_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SAvengingWrathHP = (int) SAvengingWrathHP.Value;
        }

        private void SDivineFavor_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDivineFavor = (int) SDivineFavor.Value;
        }

        private void SDivineLight_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDivineLight = (int) SDivineLight.Value;
        }

        private void SGuardianofAncientKingsHP_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGuardianofAncientKingsHP = (int) SGuardianofAncientKingsHP.Value;
        }

        private void SHolyAvenger_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHolyAvenger = (int) SHolyAvenger.Value;
        }

        private void SEternalFlameBlanketHolyPower_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SEternalFlameBlanketHolyPower = (int) SEternalFlameBlanketHolyPower.Value;
        }

        private void SFlashofLight_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SFlashofLight = (int) SFlashofLight.Value;
        }

        private void SHolyLight_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHolyLight = (int) SHolyLight.Value;
        }

        private void SWordofGlory_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SWordofGlory = (int) SWordofGlory.Value;
        }

        #region Group Healing

        private void SGroup1_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup1 = SGroup1.Checked;
        }

        private void SGroup2_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup2 = SGroup2.Checked;
        }

        private void SGroup3_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup3 = SGroup3.Checked;
        }

        private void SGroup4_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup4 = SGroup4.Checked;
        }

        private void SGroup5_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup5 = SGroup5.Checked;
        }

        private void SGroup6_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup6 = SGroup6.Checked;
        }

        private void SGroup7_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup7 = SGroup7.Checked;
        }

        private void SGroup8_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGroup8 = SGroup8.Checked;
        }

        #endregion

        #endregion

        #region Protection

        private void SArdentDefender_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SArdentDefender = (int) SArdentDefender.Value;
        }

        private void SFlashofLightMeProt_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SFlashofLightMeRet = (int) SFlashofLightMeProt.Value;
        }

        private void SGuardianofAncientKingsProt_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SGuardianofAncientKingsProt = (int) SGuardianofAncientKingsProt.Value;
        }

        private void SUnittoStartAoEProt_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SUnittoStartAoE = (int) SUnittoStartAoEProt.Value;
        }

        private void SUnittoSealofRighteousnessProt_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SUnittoSealofRighteousness = (int) SUnittoSealofRighteousnessProt.Value;
        }

        private void SWordofGloryMeProt_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SWordofGloryMeRet = (int) SWordofGloryMeProt.Value;
        }

        #endregion

        #region Retribution

        private void SSacredShieldRet_CheckedChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SSacredShieldRet = SSacredShieldRet.Checked;
        }

        private void SDivineStormUnit_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SDivineStormUnit = (int)SDivineStormUnit.Value;
        }

        private void SFlashofLightMeRet_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SFlashofLightMeRet = (int) SFlashofLightMeRet.Value;
        }

        private void SFlashofLightFriendRet_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SFlashofLightFriendRet = (int) SFlashofLightFriendRet.Value;
        }

        private void SHammeroftheRighteousUnit_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SHammeroftheRighteousUnit = (int)SHammeroftheRighteousUnit.Value;
        }

        private void SInquisitionHolyPower_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SInquisitionHolyPower = (int) SInquisitionHolyPower.Value;
        }

        private void SUnittoStartAoE_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SUnittoStartAoE = (int) SUnittoStartAoE.Value;
        }

        private void SUnittoSealofRighteousness_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SUnittoSealofRighteousness = (int) SUnittoSealofRighteousness.Value;
        }

        private void SWordofGloryMeRet_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SWordofGloryMeRet = (int) SWordofGloryMeRet.Value;
        }

        private void SWordofGloryFriendRet_ValueChanged(object sender, EventArgs e)
        {
            THSettings.Instance.SWordofGloryFriendRet = (int) SWordofGloryFriendRet.Value;
        }



        #endregion

        #region Load Default Setting

        private void LoadDefaultSetting()
        {
            Logging.Write("----------------------------------");
            Logging.Write("Load Default Setting");
            Logging.Write("----------------------------------");

            #region Load General

            THSettings.Instance.SLastSavedSpec = GetCurrentSpec();
            SRebuke.Value = TalentValue(2000, 2000, 2000);
            SHammerofJustice.Value = TalentValue(2000, 2000, 2000);
            SBlindingLight.Value = TalentValue(2000, 2000, 2000);
            SRepentanceCC.Checked = TalentValue(true, true, true);

            //SProfBuff.SelectedIndex = TalentValue(5, 6, 6);
            //SProfBuffHP.Value = TalentValue(40, 90, 90);
            //SBurstKey.SelectedIndex = TalentValue(5, 6, 6);
            //SBurstHP.Value = TalentValue(40, 90, 90);
            SHealthStone.Value = TalentValue(40, 40, 40);

            SCrowdControl.Value = TalentValue(50, 50, 50);
            SDevotionAura.Value = TalentValue(50, 50, 50);
            SDivinePlea.Value = TalentValue(80, 60, 60);
            SDivineProtection.Value = TalentValue(80, 80, 80);
            SDivineShield.Value = TalentValue(30, 30, 30);
            SHandofSacrifice.Value = TalentValue(80, 80, 80);
            SHandofProtection.Value = TalentValue(30, 30, 30);
            SLayonHands.Value = TalentValue(30, 30, 30);
            SSelflessHealer.Value = TalentValue(80, 80, 80);
            SUse90Attack.Value = TalentValue(100, 100, 100);
            SUse90Defense.Value = TalentValue(80, 80, 80);

            SHandofFreedomMyself.Checked = TalentValue(true, true, true);
            SHandofFreedomMelee.Checked = TalentValue(true, true, true);
            SHandofFreedomCaster.Checked = TalentValue(false, false, false);
            SHandofFreedomHealer.Checked = TalentValue(false, false, false);


            SBuff.Checked = TalentValue(true, true, true);
            SMoveToTarget.Checked = TalentValue(true, true, true);
            SRighteousFury.Checked = TalentValue(true, true, true);
            SRacial.Checked = TalentValue(true, true, true);
            SAutoTarget.Checked = TalentValue(false, false, false);
            STaunt.Checked = TalentValue(true, true, true);
            STurnEvil.Checked = TalentValue(true, true, true);
            SPreferKings.Checked = TalentValue(true, true, false);
            SPreferMight.Checked = TalentValue(false, false, true);
            SFace.Checked = TalentValue(true, true, true);

            SStartEating.Value = TalentValue(60, 60, 60);

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = TalentValue(true, true, true);
            SCleanseDebuffNumber.Value = TalentValue(2, 0, 0);

            SManaforDPS.Value = TalentValue(50, 30, 30);
            SCrusaderStrike.Checked = TalentValue(true, true, true);
            SDenounce.Checked = TalentValue(true, true, true);
            SHammerofWrath.Checked = TalentValue(true, true, true);
            SHolyShockOffensive.Checked = TalentValue(true, true, true);
            SJudgment.Checked = TalentValue(true, true, true);

            SBeaconofLight.Checked = TalentValue(true, true, true);
            SHolyRadianceUnit.Value = TalentValue(0, 0, 0);
            SHolyRadiance.Value = TalentValue(0, 0, 0);
            SLightofDawnUnit.Value = TalentValue(0, 0, 0);
            SLightofDawn.Value = TalentValue(0, 0, 0);

            SAvengingWrathHP.Value = TalentValue(50, 70, 70);
            SDivineFavor.Value = TalentValue(50, 50, 50);
            SDivineLight.Value = TalentValue(85, 85, 85);
            SEternalFlameBlanketHolyPower.Value = TalentValue(0, 0, 0);
            SFlashofLight.Value = TalentValue(75, 50, 50);
            SGuardianofAncientKingsHP.Value = TalentValue(50, 50, 50);
            SHolyAvenger.Value = TalentValue(50, 50, 50);
            SHolyLight.Value = TalentValue(95, 95, 95);
            SWordofGlory.Value = TalentValue(70, 40, 40);

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = TalentValue(true, true, true);
            SDivineStormUnit.Value = TalentValue(2, 2, 2);
            SFlashofLightMeRet.Value = TalentValue(50, 50, 50);
            SFlashofLightFriendRet.Value = TalentValue(30, 30, 30);
            SHammeroftheRighteousUnit.Value = TalentValue(4, 4, 4);
            SInquisitionHolyPower.Value = TalentValue(3, 3, 3);
            SUnittoStartAoE.Value = TalentValue(5, 5, 5);
            SUnittoSealofRighteousness.Value = TalentValue(10, 10, 10);
            SWordofGloryMeRet.Value = TalentValue(70, 70, 70);
            SWordofGloryFriendRet.Value = TalentValue(50, 50, 50);

            #endregion

            #region Load Protection

            SArdentDefender.Value = TalentValue(25, 25, 25);
            SFlashofLightMeProt.Value = TalentValue(30, 30, 30);
            SGuardianofAncientKingsProt.Value = TalentValue(50, 50, 50);
            SUnittoStartAoEProt.Value = TalentValue(3, 3, 3);
            SUnittoSealofRighteousnessProt.Value = TalentValue(8, 8, 8);
            SWordofGloryMeProt.Value = TalentValue(70, 70, 70);

            #endregion
        }

        #endregion

        #region User Setting 1

        #region Su1Load_Click

        private void Su1Load_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Load User Settings 1.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Load User Settings 1");
            Logging.Write("----------------------------------");
            LoadSu1();
        }

        #endregion

        #region Su1Save_Click

        private void Su1Save_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Save current setting to User Settings 1.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Save current setting to User Settings 1");
            Logging.Write("----------------------------------");
            SaveSu1();
            THSettings.Instance.Save();
        }

        #endregion

        #region LoadSu1

        private void LoadSu1()
        {
            #region Load General

            SRebuke.Value = THSettings.Instance.Su1Rebuke;
            SHammerofJustice.Value = THSettings.Instance.Su1HammerofJustice;
            SBlindingLight.Value = THSettings.Instance.Su1BlindingLight;
            SHandofProtectionRemoveCC.Checked = THSettings.Instance.Su1HandofProtectionRemoveCC;
            SRepentanceCC.Checked = THSettings.Instance.Su1RepentanceCC;

            STrinket1.SelectedIndex = THSettings.Instance.Su1Trinket1;
            STrinket1HP.Value = THSettings.Instance.Su1Trinket1HP;
            STrinket2.SelectedIndex = THSettings.Instance.Su1Trinket2;
            STrinket2HP.Value = THSettings.Instance.Su1Trinket2HP;

            SProfBuff.SelectedIndex = THSettings.Instance.Su1ProfBuff;
            SProfBuffHP.Value = THSettings.Instance.Su1ProfBuffHP;
            SBurstKey.SelectedIndex = THSettings.Instance.Su1BurstKey;
            SBurstHP.Value = THSettings.Instance.Su1BurstHP;
            SHealthStone.Value = THSettings.Instance.Su1HealthStone;

            SCrowdControl.Value = THSettings.Instance.Su1CrowdControl;
            SDevotionAura.Value = THSettings.Instance.Su1DevotionAura;
            SDivinePlea.Value = THSettings.Instance.Su1DivinePlea;
            SDivineProtection.Value = THSettings.Instance.Su1DivineProtection;
            SDivineShield.Value = THSettings.Instance.Su1DivineShield;
            SHandofSacrifice.Value = THSettings.Instance.Su1HandofSacrifice;
            SHandofProtection.Value = THSettings.Instance.Su1HandofProtection;
            SLayonHands.Value = THSettings.Instance.Su1LayonHands;
            SSelflessHealer.Value = THSettings.Instance.Su1SelflessHealer;
            SUse90Attack.Value = THSettings.Instance.Su1Use90Attack;
            SUse90Defense.Value = THSettings.Instance.Su1Use90Defense;

            SHandofFreedomMyself.Checked = THSettings.Instance.Su1HandofFreedomMyself;
            SHandofFreedomMelee.Checked = THSettings.Instance.Su1HandofFreedomMelee;
            SHandofFreedomCaster.Checked = THSettings.Instance.Su1HandofFreedomCaster;
            SHandofFreedomHealer.Checked = THSettings.Instance.Su1HandofFreedomHealer;


            SBuff.Checked = THSettings.Instance.Su1Buff;
            SMoveToTarget.Checked = THSettings.Instance.Su1MoveToTarget;
            SRighteousFury.Checked = THSettings.Instance.Su1RighteousFury;
            SRacial.Checked = THSettings.Instance.Su1Racial;
            SAutoTarget.Checked = THSettings.Instance.Su1AutoTarget;
            STaunt.Checked = THSettings.Instance.Su1Taunt;
            STurnEvil.Checked = THSettings.Instance.Su1TurnEvil;
            SPreferKings.Checked = THSettings.Instance.Su1PreferKings;
            SPreferMight.Checked = THSettings.Instance.Su1PreferMight;
            SFace.Checked = THSettings.Instance.Su1Face;

            SStartEating.Value = THSettings.Instance.Su1StartEating;

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = THSettings.Instance.Su1CleanseASAP;
            SCleanseDebuffNumber.Value = THSettings.Instance.Su1CleanseDebuffNumber;

            SManaforDPS.Value = THSettings.Instance.Su1ManaforDPS;
            SCrusaderStrike.Checked = THSettings.Instance.Su1CrusaderStrike;
            SDenounce.Checked = THSettings.Instance.Su1Denounce;
            SHammerofWrath.Checked = THSettings.Instance.Su1HammerofWrath;
            SHolyShockOffensive.Checked = THSettings.Instance.Su1HolyShockOffensive;
            SJudgment.Checked = THSettings.Instance.Su1Judgment;

            SBeaconofLight.Checked = THSettings.Instance.Su1BeaconofLight;
            SHolyRadianceUnit.Value = THSettings.Instance.Su1HolyRadianceUnit;
            SHolyRadiance.Value = THSettings.Instance.Su1HolyRadiance;
            SLightofDawnUnit.Value = THSettings.Instance.Su1LightofDawnUnit;
            SLightofDawn.Value = THSettings.Instance.Su1LightofDawn;

            SAvengingWrathHP.Value = THSettings.Instance.Su1AvengingWrathHP;
            SDivineFavor.Value = THSettings.Instance.Su1DivineFavor;
            SDivineLight.Value = THSettings.Instance.Su1DivineLight;
            SEternalFlameBlanketHolyPower.Value = THSettings.Instance.Su1EternalFlameBlanketHolyPower;
            SFlashofLight.Value = THSettings.Instance.Su1FlashofLight;
            SGuardianofAncientKingsHP.Value = THSettings.Instance.Su1GuardianofAncientKingsHP;
            SHolyAvenger.Value = THSettings.Instance.Su1HolyAvenger;
            SHolyLight.Value = THSettings.Instance.Su1HolyLight;
            SWordofGlory.Value = THSettings.Instance.Su1WordofGlory;

            SGroup1.Checked = THSettings.Instance.Su1Group1;
            SGroup2.Checked = THSettings.Instance.Su1Group2;
            SGroup3.Checked = THSettings.Instance.Su1Group3;
            SGroup4.Checked = THSettings.Instance.Su1Group4;
            SGroup5.Checked = THSettings.Instance.Su1Group5;
            SGroup6.Checked = THSettings.Instance.Su1Group6;
            SGroup7.Checked = THSettings.Instance.Su1Group7;
            SGroup8.Checked = THSettings.Instance.Su1Group8;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = THSettings.Instance.Su1SacredShieldRet;
            SDivineStormUnit.Value = THSettings.Instance.Su1SDivineStormUnit;
            SFlashofLightMeRet.Value = THSettings.Instance.Su1FlashofLightMeRet;
            SFlashofLightFriendRet.Value = THSettings.Instance.Su1FlashofLightFriendRet;
            SHammeroftheRighteousUnit.Value = THSettings.Instance.Su1SHammeroftheRighteousUnit;
            SInquisitionHolyPower.Value = THSettings.Instance.Su1InquisitionHolyPower;
            SUnittoStartAoE.Value = THSettings.Instance.Su1UnittoStartAoE;
            SUnittoSealofRighteousness.Value = THSettings.Instance.Su1UnittoSealofRighteousness;
            SWordofGloryMeRet.Value = THSettings.Instance.Su1WordofGloryMeRet;
            SWordofGloryFriendRet.Value = THSettings.Instance.Su1WordofGloryFriendRet;

            #endregion

            #region Load Protection

            SArdentDefender.Value = THSettings.Instance.Su1ArdentDefender;
            //THSettings.Instance.Su1FlashofLightMeProt = (int)SFlashofLightMeProt.Value;
            SGuardianofAncientKingsProt.Value = THSettings.Instance.Su1GuardianofAncientKingsProt;
            //THSettings.Instance.Su1UnittoStartAoEProt = (int)SUnittoStartAoEProt.Value;
            //THSettings.Instance.Su1UnittoSealofRighteousnessProt = (int)SUnittoSealofRighteousnessProt.Value;
            //THSettings.Instance.Su1WordofGloryMeProt = (int)SWordofGloryMeProt.Value;

            #endregion
        }

        #endregion

        #region SaveSu1

        private void SaveSu1()
        {
            #region Load General

            THSettings.Instance.Su1Rebuke = (int) SRebuke.Value;
            THSettings.Instance.Su1HammerofJustice = (int) SHammerofJustice.Value;
            THSettings.Instance.Su1BlindingLight = (int) SBlindingLight.Value;
            THSettings.Instance.Su1HandofProtectionRemoveCC = SHandofProtectionRemoveCC.Checked;
            THSettings.Instance.Su1RepentanceCC = SRepentanceCC.Checked;


            THSettings.Instance.Su1Trinket1 = STrinket1.SelectedIndex;
            THSettings.Instance.Su1Trinket1HP = (int)STrinket1HP.Value;
            THSettings.Instance.Su1Trinket2 = STrinket2.SelectedIndex;
            THSettings.Instance.Su1Trinket2HP = (int)STrinket2HP.Value;

            THSettings.Instance.Su1ProfBuff = SProfBuff.SelectedIndex;
            THSettings.Instance.Su1ProfBuffHP = (int) SProfBuffHP.Value;
            THSettings.Instance.Su1BurstKey = SBurstKey.SelectedIndex;
            THSettings.Instance.Su1BurstHP = (int) SBurstHP.Value;
            THSettings.Instance.Su1HealthStone = (int) SHealthStone.Value;

            THSettings.Instance.Su1CrowdControl = (int) SCrowdControl.Value;
            THSettings.Instance.Su1DevotionAura = (int) SDevotionAura.Value;
            THSettings.Instance.Su1DivinePlea = (int) SDivinePlea.Value;
            THSettings.Instance.Su1DivineProtection = (int) SDivineProtection.Value;
            THSettings.Instance.Su1DivineShield = (int) SDivineShield.Value;
            THSettings.Instance.Su1HandofSacrifice = (int) SHandofSacrifice.Value;
            THSettings.Instance.Su1HandofProtection = (int) SHandofProtection.Value;
            THSettings.Instance.Su1LayonHands = (int) SLayonHands.Value;
            THSettings.Instance.Su1SelflessHealer = (int) SSelflessHealer.Value;
            THSettings.Instance.Su1Use90Attack = (int) SUse90Attack.Value;
            THSettings.Instance.Su1Use90Defense = (int) SUse90Defense.Value;

            THSettings.Instance.Su1HandofFreedomMyself = SHandofFreedomMyself.Checked;
            THSettings.Instance.Su1HandofFreedomMelee = SHandofFreedomMelee.Checked;
            THSettings.Instance.Su1HandofFreedomCaster = SHandofFreedomCaster.Checked;
            THSettings.Instance.Su1HandofFreedomHealer = SHandofFreedomHealer.Checked;


            THSettings.Instance.Su1Buff = SBuff.Checked;
            THSettings.Instance.Su1MoveToTarget = SMoveToTarget.Checked;
            THSettings.Instance.Su1RighteousFury = SRighteousFury.Checked;
            THSettings.Instance.Su1Racial = SRacial.Checked;
            THSettings.Instance.Su1AutoTarget = SAutoTarget.Checked;
            THSettings.Instance.Su1Taunt = STaunt.Checked;
            THSettings.Instance.Su1TurnEvil = STurnEvil.Checked;
            THSettings.Instance.Su1PreferKings = SPreferKings.Checked;
            THSettings.Instance.Su1PreferMight = SPreferMight.Checked;
            THSettings.Instance.Su1Face = SFace.Checked;

            THSettings.Instance.Su1StartEating = (int) SStartEating.Value;

            #endregion

            #region Load Holy

            THSettings.Instance.Su1CleanseASAP = SCleanseASAP.Checked;
            THSettings.Instance.Su1CleanseDebuffNumber = (int) SCleanseDebuffNumber.Value;

            THSettings.Instance.Su1ManaforDPS = (int) SManaforDPS.Value;
            THSettings.Instance.Su1CrusaderStrike = SCrusaderStrike.Checked;
            THSettings.Instance.Su1Denounce = SDenounce.Checked;
            THSettings.Instance.Su1HammerofWrath = SHammerofWrath.Checked;
            THSettings.Instance.Su1HolyShockOffensive = SHolyShockOffensive.Checked;
            THSettings.Instance.Su1Judgment = SJudgment.Checked;

            THSettings.Instance.Su1BeaconofLight = SBeaconofLight.Checked;
            THSettings.Instance.Su1HolyRadianceUnit = (int) SHolyRadianceUnit.Value;
            THSettings.Instance.Su1HolyRadiance = (int) SHolyRadiance.Value;
            THSettings.Instance.Su1LightofDawnUnit = (int) SLightofDawnUnit.Value;
            THSettings.Instance.Su1LightofDawn = (int) SLightofDawn.Value;

            THSettings.Instance.Su1AvengingWrathHP = (int) SAvengingWrathHP.Value;
            THSettings.Instance.Su1DivineFavor = (int) SDivineFavor.Value;
            THSettings.Instance.Su1DivineLight = (int) SDivineLight.Value;
            THSettings.Instance.Su1EternalFlameBlanketHolyPower = (int) SEternalFlameBlanketHolyPower.Value;
            THSettings.Instance.Su1FlashofLight = (int) SFlashofLight.Value;
            THSettings.Instance.Su1GuardianofAncientKingsHP = (int) SGuardianofAncientKingsHP.Value;
            THSettings.Instance.Su1HolyAvenger = (int) SHolyAvenger.Value;
            THSettings.Instance.Su1HolyLight = (int) SHolyLight.Value;
            THSettings.Instance.Su1WordofGlory = (int) SWordofGlory.Value;

            THSettings.Instance.Su1Group1 = SGroup1.Checked;
            THSettings.Instance.Su1Group2 = SGroup2.Checked;
            THSettings.Instance.Su1Group3 = SGroup3.Checked;
            THSettings.Instance.Su1Group4 = SGroup4.Checked;
            THSettings.Instance.Su1Group5 = SGroup5.Checked;
            THSettings.Instance.Su1Group6 = SGroup6.Checked;
            THSettings.Instance.Su1Group7 = SGroup7.Checked;
            THSettings.Instance.Su1Group8 = SGroup8.Checked;

            #endregion

            #region Load Retribution

            THSettings.Instance.Su1SacredShieldRet = SSacredShieldRet.Checked;
            THSettings.Instance.Su1FlashofLightMeRet = (int) SFlashofLightMeRet.Value;
            THSettings.Instance.Su1SDivineStormUnit = (int) SDivineStormUnit.Value;
            THSettings.Instance.Su1FlashofLightFriendRet = (int) SFlashofLightFriendRet.Value;
            THSettings.Instance.Su1SHammeroftheRighteousUnit = (int) SHammeroftheRighteousUnit.Value;
            THSettings.Instance.Su1InquisitionHolyPower = (int) SInquisitionHolyPower.Value;
            THSettings.Instance.Su1UnittoStartAoE = (int) SUnittoStartAoE.Value;
            THSettings.Instance.Su1UnittoSealofRighteousness = (int) SUnittoSealofRighteousness.Value;
            THSettings.Instance.Su1WordofGloryMeRet = (int) SWordofGloryMeRet.Value;
            THSettings.Instance.Su1WordofGloryFriendRet = (int) SWordofGloryFriendRet.Value;

            #endregion

            #region Load Protection

            THSettings.Instance.Su1ArdentDefender = (int) SArdentDefender.Value;
            //SFlashofLightMeProt.Value = THSettings.Instance.Su1FlashofLightMeProt;
            THSettings.Instance.Su1GuardianofAncientKingsProt = (int) SGuardianofAncientKingsProt.Value;
            //UnittoStartAoEProt.Value = THSettings.Instance.Su1UnittoStartAoEProt;
            //SUnittoSealofRighteousnessProt.Value = THSettings.Instance.Su1UnittoSealofRighteousnessProt;
            //SWordofGloryMeProt.Value = THSettings.Instance.Su1WordofGloryMeProt;

            #endregion
        }

        #endregion

        #endregion

        #region User Setting 2

        #region Su2Load_Click

        private void Su2Load_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Load User Settings 2.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Load User Settings 2");
            Logging.Write("----------------------------------");
            LoadSu2();
        }

        #endregion

        #region Su2Save_Click

        private void Su2Save_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Save current setting to User Settings 2.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Save current setting to User Settings 2");
            Logging.Write("----------------------------------");
            SaveSu2();
            THSettings.Instance.Save();
        }

        #endregion

        #region LoadSu2

        private void LoadSu2()
        {
            #region Load General

            SRebuke.Value = THSettings.Instance.Su2Rebuke;
            SHammerofJustice.Value = THSettings.Instance.Su2HammerofJustice;
            SBlindingLight.Value = THSettings.Instance.Su2BlindingLight;
            SHandofProtectionRemoveCC.Checked = THSettings.Instance.Su2HandofProtectionRemoveCC;
            SRepentanceCC.Checked = THSettings.Instance.Su2RepentanceCC;

            STrinket1.SelectedIndex = THSettings.Instance.Su2Trinket1;
            STrinket1HP.Value = THSettings.Instance.Su2Trinket1HP;
            STrinket2.SelectedIndex = THSettings.Instance.Su2Trinket2;
            STrinket2HP.Value = THSettings.Instance.Su2Trinket2HP;

            SProfBuff.SelectedIndex = THSettings.Instance.Su2ProfBuff;
            SProfBuffHP.Value = THSettings.Instance.Su2ProfBuffHP;
            SBurstKey.SelectedIndex = THSettings.Instance.Su2BurstKey;
            SBurstHP.Value = THSettings.Instance.Su2BurstHP;
            SHealthStone.Value = THSettings.Instance.Su2HealthStone;

            SCrowdControl.Value = THSettings.Instance.Su2CrowdControl;
            SDevotionAura.Value = THSettings.Instance.Su2DevotionAura;
            SDivinePlea.Value = THSettings.Instance.Su2DivinePlea;
            SDivineProtection.Value = THSettings.Instance.Su2DivineProtection;
            SDivineShield.Value = THSettings.Instance.Su2DivineShield;
            SHandofSacrifice.Value = THSettings.Instance.Su2HandofSacrifice;
            SHandofProtection.Value = THSettings.Instance.Su2HandofProtection;
            SLayonHands.Value = THSettings.Instance.Su2LayonHands;
            SSelflessHealer.Value = THSettings.Instance.Su2SelflessHealer;
            SUse90Attack.Value = THSettings.Instance.Su2Use90Attack;
            SUse90Defense.Value = THSettings.Instance.Su2Use90Defense;

            SHandofFreedomMyself.Checked = THSettings.Instance.Su2HandofFreedomMyself;
            SHandofFreedomMelee.Checked = THSettings.Instance.Su2HandofFreedomMelee;
            SHandofFreedomCaster.Checked = THSettings.Instance.Su2HandofFreedomCaster;
            SHandofFreedomHealer.Checked = THSettings.Instance.Su2HandofFreedomHealer;


            SBuff.Checked = THSettings.Instance.Su2Buff;
            SMoveToTarget.Checked = THSettings.Instance.Su2MoveToTarget;
            SRighteousFury.Checked = THSettings.Instance.Su2RighteousFury;
            SRacial.Checked = THSettings.Instance.Su2Racial;
            SAutoTarget.Checked = THSettings.Instance.Su2AutoTarget;
            STaunt.Checked = THSettings.Instance.Su2Taunt;
            STurnEvil.Checked = THSettings.Instance.Su2TurnEvil;
            SPreferKings.Checked = THSettings.Instance.Su2PreferKings;
            SPreferMight.Checked = THSettings.Instance.Su2PreferMight;
            SFace.Checked = THSettings.Instance.Su2Face;

            SStartEating.Value = THSettings.Instance.Su2StartEating;

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = THSettings.Instance.Su2CleanseASAP;
            SCleanseDebuffNumber.Value = THSettings.Instance.Su2CleanseDebuffNumber;

            SManaforDPS.Value = THSettings.Instance.Su2ManaforDPS;
            SCrusaderStrike.Checked = THSettings.Instance.Su2CrusaderStrike;
            SDenounce.Checked = THSettings.Instance.Su2Denounce;
            SHammerofWrath.Checked = THSettings.Instance.Su2HammerofWrath;
            SHolyShockOffensive.Checked = THSettings.Instance.Su2HolyShockOffensive;
            SJudgment.Checked = THSettings.Instance.Su2Judgment;

            SBeaconofLight.Checked = THSettings.Instance.Su2BeaconofLight;
            SHolyRadianceUnit.Value = THSettings.Instance.Su2HolyRadianceUnit;
            SHolyRadiance.Value = THSettings.Instance.Su2HolyRadiance;
            SLightofDawnUnit.Value = THSettings.Instance.Su2LightofDawnUnit;
            SLightofDawn.Value = THSettings.Instance.Su2LightofDawn;

            SAvengingWrathHP.Value = THSettings.Instance.Su2AvengingWrathHP;
            SDivineFavor.Value = THSettings.Instance.Su2DivineFavor;
            SDivineLight.Value = THSettings.Instance.Su2DivineLight;
            SEternalFlameBlanketHolyPower.Value = THSettings.Instance.Su2EternalFlameBlanketHolyPower;
            SFlashofLight.Value = THSettings.Instance.Su2FlashofLight;
            SGuardianofAncientKingsHP.Value = THSettings.Instance.Su2GuardianofAncientKingsHP;
            SHolyAvenger.Value = THSettings.Instance.Su2HolyAvenger;
            SHolyLight.Value = THSettings.Instance.Su2HolyLight;
            SWordofGlory.Value = THSettings.Instance.Su2WordofGlory;

            SGroup1.Checked = THSettings.Instance.Su2Group1;
            SGroup2.Checked = THSettings.Instance.Su2Group2;
            SGroup3.Checked = THSettings.Instance.Su2Group3;
            SGroup4.Checked = THSettings.Instance.Su2Group4;
            SGroup5.Checked = THSettings.Instance.Su2Group5;
            SGroup6.Checked = THSettings.Instance.Su2Group6;
            SGroup7.Checked = THSettings.Instance.Su2Group7;
            SGroup8.Checked = THSettings.Instance.Su2Group8;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = THSettings.Instance.Su2SacredShieldRet;
            SDivineStormUnit.Value = THSettings.Instance.Su2SDivineStormUnit;
            SFlashofLightMeRet.Value = THSettings.Instance.Su2FlashofLightMeRet;
            SFlashofLightFriendRet.Value = THSettings.Instance.Su2FlashofLightFriendRet;
            SHammeroftheRighteousUnit.Value = THSettings.Instance.Su2SHammeroftheRighteousUnit;
            SInquisitionHolyPower.Value = THSettings.Instance.Su2InquisitionHolyPower;
            SUnittoStartAoE.Value = THSettings.Instance.Su2UnittoStartAoE;
            SUnittoSealofRighteousness.Value = THSettings.Instance.Su2UnittoSealofRighteousness;
            SWordofGloryMeRet.Value = THSettings.Instance.Su2WordofGloryMeRet;
            SWordofGloryFriendRet.Value = THSettings.Instance.Su2WordofGloryFriendRet;

            #endregion

            #region Load Protection

            SArdentDefender.Value = THSettings.Instance.Su2ArdentDefender;
            //THSettings.Instance.Su2FlashofLightMeProt = (int)SFlashofLightMeProt.Value;
            SGuardianofAncientKingsProt.Value = THSettings.Instance.Su2GuardianofAncientKingsProt;
            //THSettings.Instance.Su2UnittoStartAoEProt = (int)SUnittoStartAoEProt.Value;
            //THSettings.Instance.Su2UnittoSealofRighteousnessProt = (int)SUnittoSealofRighteousnessProt.Value;
            //THSettings.Instance.Su2WordofGloryMeProt = (int)SWordofGloryMeProt.Value;

            #endregion
        }

        #endregion

        #region SaveSu2

        private void SaveSu2()
        {
            #region Load General

            THSettings.Instance.Su2Rebuke = (int) SRebuke.Value;
            THSettings.Instance.Su2HammerofJustice = (int) SHammerofJustice.Value;
            THSettings.Instance.Su2BlindingLight = (int) SBlindingLight.Value;
            THSettings.Instance.Su2HandofProtectionRemoveCC = SHandofProtectionRemoveCC.Checked;
            THSettings.Instance.Su2RepentanceCC = SRepentanceCC.Checked;

            THSettings.Instance.Su2Trinket1 = STrinket1.SelectedIndex;
            THSettings.Instance.Su2Trinket1HP = (int)STrinket1HP.Value;
            THSettings.Instance.Su2Trinket2 = STrinket2.SelectedIndex;
            THSettings.Instance.Su2Trinket2HP = (int)STrinket2HP.Value;

            THSettings.Instance.Su2ProfBuff = SProfBuff.SelectedIndex;
            THSettings.Instance.Su2ProfBuffHP = (int) SProfBuffHP.Value;
            THSettings.Instance.Su2BurstKey = SBurstKey.SelectedIndex;
            THSettings.Instance.Su2BurstHP = (int) SBurstHP.Value;
            THSettings.Instance.Su2HealthStone = (int) SHealthStone.Value;

            THSettings.Instance.Su2CrowdControl = (int) SCrowdControl.Value;
            THSettings.Instance.Su2DevotionAura = (int) SDevotionAura.Value;
            THSettings.Instance.Su2DivinePlea = (int) SDivinePlea.Value;
            THSettings.Instance.Su2DivineProtection = (int) SDivineProtection.Value;
            THSettings.Instance.Su2DivineShield = (int) SDivineShield.Value;
            THSettings.Instance.Su2HandofSacrifice = (int) SHandofSacrifice.Value;
            THSettings.Instance.Su2HandofProtection = (int) SHandofProtection.Value;
            THSettings.Instance.Su2LayonHands = (int) SLayonHands.Value;
            THSettings.Instance.Su2SelflessHealer = (int) SSelflessHealer.Value;
            THSettings.Instance.Su2Use90Attack = (int) SUse90Attack.Value;
            THSettings.Instance.Su2Use90Defense = (int) SUse90Defense.Value;

            THSettings.Instance.Su2HandofFreedomMyself = SHandofFreedomMyself.Checked;
            THSettings.Instance.Su2HandofFreedomMelee = SHandofFreedomMelee.Checked;
            THSettings.Instance.Su2HandofFreedomCaster = SHandofFreedomCaster.Checked;
            THSettings.Instance.Su2HandofFreedomHealer = SHandofFreedomHealer.Checked;


            THSettings.Instance.Su2Buff = SBuff.Checked;
            THSettings.Instance.Su2MoveToTarget = SMoveToTarget.Checked;
            THSettings.Instance.Su2RighteousFury = SRighteousFury.Checked;
            THSettings.Instance.Su2Racial = SRacial.Checked;
            THSettings.Instance.Su2AutoTarget = SAutoTarget.Checked;
            THSettings.Instance.Su2Taunt = STaunt.Checked;
            THSettings.Instance.Su2TurnEvil = STurnEvil.Checked;
            THSettings.Instance.Su2PreferKings = SPreferKings.Checked;
            THSettings.Instance.Su2PreferMight = SPreferMight.Checked;
            THSettings.Instance.Su2Face = SFace.Checked;

            THSettings.Instance.Su2StartEating = (int) SStartEating.Value;

            #endregion

            #region Load Holy

            THSettings.Instance.Su2CleanseASAP = SCleanseASAP.Checked;
            THSettings.Instance.Su2CleanseDebuffNumber = (int) SCleanseDebuffNumber.Value;

            THSettings.Instance.Su2ManaforDPS = (int) SManaforDPS.Value;
            THSettings.Instance.Su2CrusaderStrike = SCrusaderStrike.Checked;
            THSettings.Instance.Su2Denounce = SDenounce.Checked;
            THSettings.Instance.Su2HammerofWrath = SHammerofWrath.Checked;
            THSettings.Instance.Su2HolyShockOffensive = SHolyShockOffensive.Checked;
            THSettings.Instance.Su2Judgment = SJudgment.Checked;

            THSettings.Instance.Su2BeaconofLight = SBeaconofLight.Checked;
            THSettings.Instance.Su2HolyRadianceUnit = (int) SHolyRadianceUnit.Value;
            THSettings.Instance.Su2HolyRadiance = (int) SHolyRadiance.Value;
            THSettings.Instance.Su2LightofDawnUnit = (int) SLightofDawnUnit.Value;
            THSettings.Instance.Su2LightofDawn = (int) SLightofDawn.Value;

            THSettings.Instance.Su2AvengingWrathHP = (int) SAvengingWrathHP.Value;
            THSettings.Instance.Su2DivineFavor = (int) SDivineFavor.Value;
            THSettings.Instance.Su2DivineLight = (int) SDivineLight.Value;
            THSettings.Instance.Su2EternalFlameBlanketHolyPower = (int) SEternalFlameBlanketHolyPower.Value;
            THSettings.Instance.Su2FlashofLight = (int) SFlashofLight.Value;
            THSettings.Instance.Su2GuardianofAncientKingsHP = (int) SGuardianofAncientKingsHP.Value;
            THSettings.Instance.Su2HolyAvenger = (int) SHolyAvenger.Value;
            THSettings.Instance.Su2HolyLight = (int) SHolyLight.Value;
            THSettings.Instance.Su2WordofGlory = (int) SWordofGlory.Value;

            THSettings.Instance.Su2Group1 = SGroup1.Checked;
            THSettings.Instance.Su2Group2 = SGroup2.Checked;
            THSettings.Instance.Su2Group3 = SGroup3.Checked;
            THSettings.Instance.Su2Group4 = SGroup4.Checked;
            THSettings.Instance.Su2Group5 = SGroup5.Checked;
            THSettings.Instance.Su2Group6 = SGroup6.Checked;
            THSettings.Instance.Su2Group7 = SGroup7.Checked;
            THSettings.Instance.Su2Group8 = SGroup8.Checked;

            #endregion

            #region Load Retribution

            THSettings.Instance.Su2SacredShieldRet = SSacredShieldRet.Checked;

            THSettings.Instance.Su2FlashofLightMeRet = (int) SFlashofLightMeRet.Value;
            THSettings.Instance.Su2FlashofLightFriendRet = (int) SFlashofLightFriendRet.Value;
            THSettings.Instance.Su2InquisitionHolyPower = (int) SInquisitionHolyPower.Value;
            THSettings.Instance.Su2UnittoStartAoE = (int) SUnittoStartAoE.Value;
            THSettings.Instance.Su2UnittoSealofRighteousness = (int) SUnittoSealofRighteousness.Value;
            THSettings.Instance.Su2WordofGloryMeRet = (int) SWordofGloryMeRet.Value;
            THSettings.Instance.Su2WordofGloryFriendRet = (int) SWordofGloryFriendRet.Value;

            #endregion

            #region Load Protection

            THSettings.Instance.Su2ArdentDefender = (int) SArdentDefender.Value;
            //SFlashofLightMeProt.Value = THSettings.Instance.Su2FlashofLightMeProt;
            THSettings.Instance.Su2GuardianofAncientKingsProt = (int) SGuardianofAncientKingsProt.Value;
            //UnittoStartAoEProt.Value = THSettings.Instance.Su2UnittoStartAoEProt;
            //SUnittoSealofRighteousnessProt.Value = THSettings.Instance.Su2UnittoSealofRighteousnessProt;
            //SWordofGloryMeProt.Value = THSettings.Instance.Su2WordofGloryMeProt;

            #endregion
        }

        #endregion

        #endregion

        #region User Setting 3

        #region Su3Load_Click

        private void Su3Load_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Load User Settings 3.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Load User Settings 3");
            Logging.Write("----------------------------------");
            LoadSu3();
        }

        #endregion

        #region Su3Load_Click

        private void Su3Save_Click(object sender, EventArgs e)
        {
            MessageBox.Show(
                "Save current setting to User Settings 3.",
                "Important Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Logging.Write("----------------------------------");
            Logging.Write("Save current setting to User Settings 3");
            Logging.Write("----------------------------------");
            SaveSu3();
            THSettings.Instance.Save();
        }

        #endregion

        #region LoadSu3

        private void LoadSu3()
        {
            #region Load General

            SRebuke.Value = THSettings.Instance.Su3Rebuke;
            SHammerofJustice.Value = THSettings.Instance.Su3HammerofJustice;
            SBlindingLight.Value = THSettings.Instance.Su3BlindingLight;
            SHandofProtectionRemoveCC.Checked = THSettings.Instance.Su3HandofProtectionRemoveCC;
            SRepentanceCC.Checked = THSettings.Instance.Su3RepentanceCC;
            
            STrinket1.SelectedIndex = THSettings.Instance.Su3Trinket1;
            STrinket1HP.Value = THSettings.Instance.Su3Trinket1HP;
            STrinket2.SelectedIndex = THSettings.Instance.Su3Trinket2;
            STrinket2HP.Value = THSettings.Instance.Su3Trinket2HP;

            SProfBuff.SelectedIndex = THSettings.Instance.Su3ProfBuff;
            SProfBuffHP.Value = THSettings.Instance.Su3ProfBuffHP;
            SBurstKey.SelectedIndex = THSettings.Instance.Su3BurstKey;
            SBurstHP.Value = THSettings.Instance.Su3BurstHP;
            SHealthStone.Value = THSettings.Instance.Su3HealthStone;

            SCrowdControl.Value = THSettings.Instance.Su3CrowdControl;
            SDevotionAura.Value = THSettings.Instance.Su3DevotionAura;
            SDivinePlea.Value = THSettings.Instance.Su3DivinePlea;
            SDivineProtection.Value = THSettings.Instance.Su3DivineProtection;
            SDivineShield.Value = THSettings.Instance.Su3DivineShield;
            SHandofSacrifice.Value = THSettings.Instance.Su3HandofSacrifice;
            SHandofProtection.Value = THSettings.Instance.Su3HandofProtection;
            SLayonHands.Value = THSettings.Instance.Su3LayonHands;
            SSelflessHealer.Value = THSettings.Instance.Su3SelflessHealer;
            SUse90Attack.Value = THSettings.Instance.Su3Use90Attack;
            SUse90Defense.Value = THSettings.Instance.Su3Use90Defense;

            SHandofFreedomMyself.Checked = THSettings.Instance.Su3HandofFreedomMyself;
            SHandofFreedomMelee.Checked = THSettings.Instance.Su3HandofFreedomMelee;
            SHandofFreedomCaster.Checked = THSettings.Instance.Su3HandofFreedomCaster;
            SHandofFreedomHealer.Checked = THSettings.Instance.Su3HandofFreedomHealer;


            SBuff.Checked = THSettings.Instance.Su3Buff;
            SMoveToTarget.Checked = THSettings.Instance.Su3MoveToTarget;
            SRighteousFury.Checked = THSettings.Instance.Su3RighteousFury;
            SRacial.Checked = THSettings.Instance.Su3Racial;
            SAutoTarget.Checked = THSettings.Instance.Su3AutoTarget;
            STaunt.Checked = THSettings.Instance.Su3Taunt;
            STurnEvil.Checked = THSettings.Instance.Su3TurnEvil;
            SPreferKings.Checked = THSettings.Instance.Su3PreferKings;
            SPreferMight.Checked = THSettings.Instance.Su3PreferMight;
            SFace.Checked = THSettings.Instance.Su3Face;

            SStartEating.Value = THSettings.Instance.Su3StartEating;

            #endregion

            #region Load Holy

            SCleanseASAP.Checked = THSettings.Instance.Su3CleanseASAP;
            SCleanseDebuffNumber.Value = THSettings.Instance.Su3CleanseDebuffNumber;

            SManaforDPS.Value = THSettings.Instance.Su3ManaforDPS;
            SCrusaderStrike.Checked = THSettings.Instance.Su3CrusaderStrike;
            SDenounce.Checked = THSettings.Instance.Su3Denounce;
            SHammerofWrath.Checked = THSettings.Instance.Su3HammerofWrath;
            SHolyShockOffensive.Checked = THSettings.Instance.Su3HolyShockOffensive;
            SJudgment.Checked = THSettings.Instance.Su3Judgment;

            SBeaconofLight.Checked = THSettings.Instance.Su3BeaconofLight;
            SHolyRadianceUnit.Value = THSettings.Instance.Su3HolyRadianceUnit;
            SHolyRadiance.Value = THSettings.Instance.Su3HolyRadiance;
            SLightofDawnUnit.Value = THSettings.Instance.Su3LightofDawnUnit;
            SLightofDawn.Value = THSettings.Instance.Su3LightofDawn;

            SAvengingWrathHP.Value = THSettings.Instance.Su3AvengingWrathHP;
            SDivineFavor.Value = THSettings.Instance.Su3DivineFavor;
            SDivineLight.Value = THSettings.Instance.Su3DivineLight;
            SEternalFlameBlanketHolyPower.Value = THSettings.Instance.Su3EternalFlameBlanketHolyPower;
            SFlashofLight.Value = THSettings.Instance.Su3FlashofLight;
            SGuardianofAncientKingsHP.Value = THSettings.Instance.Su3GuardianofAncientKingsHP;
            SHolyAvenger.Value = THSettings.Instance.Su3HolyAvenger;
            SHolyLight.Value = THSettings.Instance.Su3HolyLight;
            SWordofGlory.Value = THSettings.Instance.Su3WordofGlory;

            SGroup1.Checked = THSettings.Instance.Su3Group1;
            SGroup2.Checked = THSettings.Instance.Su3Group2;
            SGroup3.Checked = THSettings.Instance.Su3Group3;
            SGroup4.Checked = THSettings.Instance.Su3Group4;
            SGroup5.Checked = THSettings.Instance.Su3Group5;
            SGroup6.Checked = THSettings.Instance.Su3Group6;
            SGroup7.Checked = THSettings.Instance.Su3Group7;
            SGroup8.Checked = THSettings.Instance.Su3Group8;

            #endregion

            #region Load Retribution

            SSacredShieldRet.Checked = THSettings.Instance.Su3SacredShieldRet;
            SDivineStormUnit.Value = THSettings.Instance.Su3SDivineStormUnit;
            SFlashofLightMeRet.Value = THSettings.Instance.Su3FlashofLightMeRet;
            SFlashofLightFriendRet.Value = THSettings.Instance.Su3FlashofLightFriendRet;
            SHammeroftheRighteousUnit.Value = THSettings.Instance.Su3SHammeroftheRighteousUnit;
            SInquisitionHolyPower.Value = THSettings.Instance.Su3InquisitionHolyPower;
            SUnittoStartAoE.Value = THSettings.Instance.Su3UnittoStartAoE;
            SUnittoSealofRighteousness.Value = THSettings.Instance.Su3UnittoSealofRighteousness;
            SWordofGloryMeRet.Value = THSettings.Instance.Su3WordofGloryMeRet;
            SWordofGloryFriendRet.Value = THSettings.Instance.Su3WordofGloryFriendRet;

            #endregion

            #region Load Protection

            SArdentDefender.Value = THSettings.Instance.Su3ArdentDefender;
            //THSettings.Instance.Su3FlashofLightMeProt = (int)SFlashofLightMeProt.Value;
            SGuardianofAncientKingsProt.Value = THSettings.Instance.Su3GuardianofAncientKingsProt;
            //THSettings.Instance.Su3UnittoStartAoEProt = (int)SUnittoStartAoEProt.Value;
            //THSettings.Instance.Su3UnittoSealofRighteousnessProt = (int)SUnittoSealofRighteousnessProt.Value;
            //THSettings.Instance.Su3WordofGloryMeProt = (int)SWordofGloryMeProt.Value;

            #endregion
        }

        #endregion

        #region SaveSu3

        private void SaveSu3()
        {
            #region Load General

            THSettings.Instance.Su3Rebuke = (int) SRebuke.Value;
            THSettings.Instance.Su3HammerofJustice = (int) SHammerofJustice.Value;
            THSettings.Instance.Su3BlindingLight = (int) SBlindingLight.Value;
            THSettings.Instance.Su3HandofProtectionRemoveCC = SHandofProtectionRemoveCC.Checked;
            THSettings.Instance.Su3RepentanceCC = SRepentanceCC.Checked;

            THSettings.Instance.Su3Trinket1 = STrinket1.SelectedIndex;
            THSettings.Instance.Su3Trinket1HP = (int)STrinket1HP.Value;
            THSettings.Instance.Su3Trinket2 = STrinket2.SelectedIndex;
            THSettings.Instance.Su3Trinket2HP = (int)STrinket2HP.Value;

            THSettings.Instance.Su3ProfBuff = SProfBuff.SelectedIndex;
            THSettings.Instance.Su3ProfBuffHP = (int) SProfBuffHP.Value;
            THSettings.Instance.Su3BurstKey = SBurstKey.SelectedIndex;
            THSettings.Instance.Su3BurstHP = (int) SBurstHP.Value;
            THSettings.Instance.Su3HealthStone = (int) SHealthStone.Value;

            THSettings.Instance.Su3CrowdControl = (int) SCrowdControl.Value;
            THSettings.Instance.Su3DevotionAura = (int) SDevotionAura.Value;
            THSettings.Instance.Su3DivinePlea = (int) SDivinePlea.Value;
            THSettings.Instance.Su3DivineProtection = (int) SDivineProtection.Value;
            THSettings.Instance.Su3DivineShield = (int) SDivineShield.Value;
            THSettings.Instance.Su3HandofSacrifice = (int) SHandofSacrifice.Value;
            THSettings.Instance.Su3HandofProtection = (int) SHandofProtection.Value;
            THSettings.Instance.Su3LayonHands = (int) SLayonHands.Value;
            THSettings.Instance.Su3SelflessHealer = (int) SSelflessHealer.Value;
            THSettings.Instance.Su3Use90Attack = (int) SUse90Attack.Value;
            THSettings.Instance.Su3Use90Defense = (int) SUse90Defense.Value;

            THSettings.Instance.Su3HandofFreedomMyself = SHandofFreedomMyself.Checked;
            THSettings.Instance.Su3HandofFreedomMelee = SHandofFreedomMelee.Checked;
            THSettings.Instance.Su3HandofFreedomCaster = SHandofFreedomCaster.Checked;
            THSettings.Instance.Su3HandofFreedomHealer = SHandofFreedomHealer.Checked;


            THSettings.Instance.Su3Buff = SBuff.Checked;
            THSettings.Instance.Su3MoveToTarget = SMoveToTarget.Checked;
            THSettings.Instance.Su3RighteousFury = SRighteousFury.Checked;
            THSettings.Instance.Su3Racial = SRacial.Checked;
            THSettings.Instance.Su3AutoTarget = SAutoTarget.Checked;
            THSettings.Instance.Su3Taunt = STaunt.Checked;
            THSettings.Instance.Su3TurnEvil = STurnEvil.Checked;
            THSettings.Instance.Su3PreferKings = SPreferKings.Checked;
            THSettings.Instance.Su3PreferMight = SPreferMight.Checked;
            THSettings.Instance.Su3Face = SFace.Checked;

            THSettings.Instance.Su3StartEating = (int) SStartEating.Value;

            #endregion

            #region Load Holy

            THSettings.Instance.Su3CleanseASAP = SCleanseASAP.Checked;
            THSettings.Instance.Su3CleanseDebuffNumber = (int) SCleanseDebuffNumber.Value;

            THSettings.Instance.Su3ManaforDPS = (int) SManaforDPS.Value;
            THSettings.Instance.Su3CrusaderStrike = SCrusaderStrike.Checked;
            THSettings.Instance.Su3Denounce = SDenounce.Checked;
            THSettings.Instance.Su3HammerofWrath = SHammerofWrath.Checked;
            THSettings.Instance.Su3HolyShockOffensive = SHolyShockOffensive.Checked;
            THSettings.Instance.Su3Judgment = SJudgment.Checked;

            THSettings.Instance.Su3BeaconofLight = SBeaconofLight.Checked;
            THSettings.Instance.Su3HolyRadianceUnit = (int) SHolyRadianceUnit.Value;
            THSettings.Instance.Su3HolyRadiance = (int) SHolyRadiance.Value;
            THSettings.Instance.Su3LightofDawnUnit = (int) SLightofDawnUnit.Value;
            THSettings.Instance.Su3LightofDawn = (int) SLightofDawn.Value;

            THSettings.Instance.Su3AvengingWrathHP = (int) SAvengingWrathHP.Value;
            THSettings.Instance.Su3DivineFavor = (int) SDivineFavor.Value;
            THSettings.Instance.Su3DivineLight = (int) SDivineLight.Value;
            THSettings.Instance.Su3EternalFlameBlanketHolyPower = (int) SEternalFlameBlanketHolyPower.Value;
            THSettings.Instance.Su3FlashofLight = (int) SFlashofLight.Value;
            THSettings.Instance.Su3GuardianofAncientKingsHP = (int) SGuardianofAncientKingsHP.Value;
            THSettings.Instance.Su3HolyAvenger = (int) SHolyAvenger.Value;
            THSettings.Instance.Su3HolyLight = (int) SHolyLight.Value;
            THSettings.Instance.Su3WordofGlory = (int) SWordofGlory.Value;

            THSettings.Instance.Su3Group1 = SGroup1.Checked;
            THSettings.Instance.Su3Group2 = SGroup2.Checked;
            THSettings.Instance.Su3Group3 = SGroup3.Checked;
            THSettings.Instance.Su3Group4 = SGroup4.Checked;
            THSettings.Instance.Su3Group5 = SGroup5.Checked;
            THSettings.Instance.Su3Group6 = SGroup6.Checked;
            THSettings.Instance.Su3Group7 = SGroup7.Checked;
            THSettings.Instance.Su3Group8 = SGroup8.Checked;

            #endregion

            #region Load Retribution

            THSettings.Instance.Su3SacredShieldRet = SSacredShieldRet.Checked;

            THSettings.Instance.Su3FlashofLightMeRet = (int) SFlashofLightMeRet.Value;
            THSettings.Instance.Su3FlashofLightFriendRet = (int) SFlashofLightFriendRet.Value;
            THSettings.Instance.Su3InquisitionHolyPower = (int) SInquisitionHolyPower.Value;
            THSettings.Instance.Su3UnittoStartAoE = (int) SUnittoStartAoE.Value;
            THSettings.Instance.Su3UnittoSealofRighteousness = (int) SUnittoSealofRighteousness.Value;
            THSettings.Instance.Su3WordofGloryMeRet = (int) SWordofGloryMeRet.Value;
            THSettings.Instance.Su3WordofGloryFriendRet = (int) SWordofGloryFriendRet.Value;

            #endregion

            #region Load Protection

            THSettings.Instance.Su3ArdentDefender = (int) SArdentDefender.Value;
            //SFlashofLightMeProt.Value = THSettings.Instance.Su3FlashofLightMeProt;
            THSettings.Instance.Su3GuardianofAncientKingsProt = (int) SGuardianofAncientKingsProt.Value;
            //UnittoStartAoEProt.Value = THSettings.Instance.Su3UnittoStartAoEProt;
            //SUnittoSealofRighteousnessProt.Value = THSettings.Instance.Su3UnittoSealofRighteousnessProt;
            //SWordofGloryMeProt.Value = THSettings.Instance.Su3WordofGloryMeProt;

            #endregion
        }

        #endregion



        #endregion
    }
}